package Thread;
public class Demo1 {
		public static void main(String[] args) throws InterruptedException {
			Repository<String> rep=new Repository<>(5);
			Thread t3=new Thread3(rep);	
			t3.start();
			Thread.sleep(3000);
			System.out.println("t3==>"+t3.getState());
			rep.take();
			rep.take();
			rep.take();
			System.out.println("t3==>"+t3.getState());
			Thread.sleep(1000);
			System.out.println("t3==>"+t3.getState());
		}
	}
	class Thread3 extends Thread{
		Repository<String> rep;

		public Thread3(Repository<String> rep) {
			
			this.rep = rep;
		}
		@Override
		public void run() {
			while(true){
				rep.save("xxx");
				System.out.println("t3--->"+getState());
			}
		}
		
	}

	
		
	



	
